#include "stdafx.h"
#include "order.h"

void OrderManager::showOrders() {
	cout << "FrontID\t\tSessionID\t\tOrderRef\t\tState\t\tVolumeTraded\t\tVolumeRemained\t\tVolumeOriginal" << endl;
	for (auto it = orderContainer.begin(); it != orderContainer.end(); it++) {

		cout << it->second->FrontID << "\t\t" << it->second->SessionID << "\t\t" << it->second->orderRef << "\t\t\t";
		if (it->second->state == OrderState::Generated) cout << "Generated";
		else if (it->second->state == OrderState::SubmittedToExchange) cout << "SubmittedToExchange";
		else if (it->second->state == OrderState::CTPRejected) cout << "CTPRejected";
		else if (it->second->state == OrderState::AllTraded) cout << "AllTraded";
		else if (it->second->state == OrderState::NoTradeQueueing) cout << "NoTradeQueueing";
		else if (it->second->state == OrderState::PartTradedQueueing) cout << "PartTradedQueueing";
		else if (it->second->state == OrderState::PartTradedNotQueueing) cout << "PartTradedNotQueueing";
		else if (it->second->state == OrderState::Cancelled) cout << "Cancelled";
		cout << "\t\t" << it->second->volumeTraded;
		cout << "\t\t" << it->second->volumeTotal;
		cout << "\t\t" << it->second->volumeOriginal;
		cout << endl;
	}
}